import {
  defineConfig
} from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import {
  svgIconsPlugin
} from '@tangllty/vite-plugin-svg'
import path from 'path'
// https://vitejs.dev/config/
export default defineConfig({

  resolve: {
    alias: [
      {
        find: '@',
        replacement: path.resolve(__dirname, 'src')
      },
    ],
    extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'],

  },
  server: {
    port: 3003,
    proxy: {
      '/api': {
        target: 'http://codeapi.liumingtai.com',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, '')
      },
    }

  },
  plugins: [
    svgIconsPlugin({
      pattern: 'src/assets/**/*.svg',
    }),
    vueJsx(),
    vue()
  ],
})
